<?php
header("content-type:text/html;charset=utf8");

$uname = $_POST["uname"];
$pass = $_POST["pass"];

$con = mysqli_connect("localhost", "root", "root", "one");
mysqli_query($con, "set names utf8");

$res = mysqli_query($con, "select * from information where username='{$uname}' and password='{$pass}'");
$row = mysqli_fetch_assoc($res);
if ($row) {
    $arr = [
        "status" => 200,
        "msg" => "登陆成功"
    ];
    echo json_encode($arr);
} else {
    $arr = [
        "status" => 400,
        "msg" => "登陆失败"
    ];
    echo json_encode($arr);
}
